import {createApp} from 'vue'
import App from './App.vue'

// import 'virtual:svg-icons-register'
import 'ant-design-vue/dist/antd.less'
import '@/assets/style/index.less'
import '@/assets/style/index.scss'
// import '@/utils/amap'

import {createFromIconfontCN} from '@ant-design/icons-vue'

// import base from 'yuxin-base'
import router from '@/router'
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
import VXETable from 'vxe-table'
import {Modal} from 'ant-design-vue'

dayjs.locale('zh-cn')



import store from '@/store'
// import AreaSelect from '@/components/common/area-select.vue'
// import SearchInput from '@/components/common/search-input.vue'
// import DeptEmpSelect from '@/components/common/dept-emp-select.vue'
import {isLockinEnv} from '@/utils/common/index'

if (isLockinEnv()) {
	const $favicon: any = document.querySelector('#favicon')
	const isLogin = location.pathname === '/login' && !location.href.includes('/login?with_blank=1')
	const shouldShowIcon =  localStorage.getItem('shouldShowIcon') === 'true' ||  isLogin
	document.title = shouldShowIcon ?  '鹿客明智云' :'管理平台'
	$favicon.href = shouldShowIcon ? '/favicon-lockin.ico' : '/blank.ico'
}

const app = createApp(App)

app.use(store).use(VXETable).use(router).use(Modal)
// .use(base)

// app.component('AreaSelect', AreaSelect)
// app.component('SearchInput', SearchInput)
// app.component('DeptEmpSelect', DeptEmpSelect)

app.mount('#app')

// setApp(app)

createFromIconfontCN({
	// 在 iconfont.cn 上生成，文件类型svg图标
	scriptUrl: '//at.alicdn.com/t/c/font_3761548_6h6if19eio6.js'
})
